<!--员工管理模板-->
<div class="bg-light lter b-b wrapper-sm">
    <h1 class="m-n font-thin h3">员工管理</h1>
</div>
<div class="wrapper-sm" ng-controller="employeeManagentController">
    <div class="panel panel-default">
        <div class="panel-heading font-bold">查询</div>
        <div class="panel-body">
            <label class="control-label pull-left m-t-xs">用户名</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm" id="table_employeeManagent_userName" name="userName" ng-model="queryTerms.userName" placeholder="请输入用户名">
            </div>
            <label class="control-label pull-left m-t-xs">真实姓名</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm" id="table_employeeManagent_realName" name="realName" ng-model="queryTerms.realName" placeholder="请输入真实姓名">
            </div>
            <label class="control-label pull-left m-t-xs">手机号</label>
            <div class="col-md-2 form-group">
                <input type="text" class="form-control input-sm" id="table_employeeManagent_phoneNumber" name="phoneNumber" ng-model="queryTerms.phoneNumber" placeholder="请输入手机号">
            </div>
            <label class="control-label pull-left m-t-xs">所属部门</label>
            <div class="col-md-2 form-group">
                <select class="form-control input-sm" id="table_employeeManagent_department" name="department" ng-model="queryTerms.departmentId" ng-options="x.id as x.name for x in departmentDropDown">
                    <option value="">全部</option>
                </select>
            </div>
            <button id="table_employeeManagent_queryFunc" ng-click="queryFunc()" class="btn btn-sm btn-default btn-addon" ng-class="{'disabled':querying}" ng-disabled="querying">
                <i class="fa fa-search" ng-show="!querying"></i>
                <i class="fa fa-spinner no-bordr" ng-show="querying" ng-class="{'fa-spin':querying}"></i>
                <span ng-show="!querying">查询</span>
                <span ng-show="querying">查询中...</span>
            </button>
        </div>
    </div>
    <div class="panel panel-default">
        <div class="panel-heading">
            员工列表
        </div>
        <div class="table-responsive">
            <div ui-grid="gridOptions" id="table_employeeManagent_gridOptions" ui-grid-pagination ui-grid-auto-resize ui-grid-resize-columns style="height:{{heightA}}px; min-height:395px; overflow:hidden; min-width:1000px;">
                <div class="watermark" ng-if="!gridOptions.data.length">暂无数据</div>
            </div>
        </div>
        <div class="panel-body">
            <button class="pull-right-xs btn btn-sm m-b-xs btn-info btn-addon" ng-click="addEmployee()" id="table_employeeManagent_addEmployee" data-toggle="modal" data-target="#myModal"><i class="fa fa-plus"></i>添加</button>
        </div>
    </div>

    <!-- 添加/编辑用户对话框 -->
    <div class="modal fade bs-example-modal-lg" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button id="table_employeeManagent_detail_close" type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">{{title}}</h4>
                </div>
                <form class="form-horizontal form-validation" id="employeeForm" novalidate>
                    <div class="modal-body">
                        <div class="form-group">
                            <label class="col-lg-3 control-label">用户名<span class="text-danger">*</span></label>
                            <div class="col-lg-4">
                                <input type="text" id="table_employeeManagent_detail_userName" ng-disabled="detail.showpassword" class="form-control" ng-model="detail.userName" placeholder="请填写用户名" name="detailUserName" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">邮箱 <span class="text-danger">*</span></label>
                            <div class="col-lg-4">
                                <input type="email" id="table_employeeManagent_detail_email" class="form-control" ng-model="detail.email" placeholder="请填写邮箱" name="email" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">手机号<span class="text-danger">*</span></label>
                            <div class="col-lg-4">
                                <input type="tel" id="table_employeeManagent_detail_phoneNumber" class="form-control" ng-model="detail.phoneNumber" ng-pattern="/^1\d{10}$/" placeholder="请填写手机号" name="phoneNumber" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">密码<span class="text-danger" ng-show="detail.show">*</span></label>
                            <div class="col-lg-4">
                                <input type="password" id="table_employeeManagent_detail_password" class="form-control" ng-model="detail.password" placeholder="请填写密码" name="password" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">{{PasswordName}}<span class="text-danger" ng-show="show"></span></label>
                            <div class="col-lg-4">
                                <input type="password" id="table_employeeManagent_detail_rePassword" class="form-control" ng-model="detail.rePassword" placeholder="请再次填写密码" name="rePassword" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">真实姓名<span class="text-danger">*</span></label>
                            <div class="col-lg-4">
                                <input type="text" id="table_employeeManagent_detail_realName" class="form-control" ng-model="detail.realName" placeholder="请填写真实姓名" name="detailRealName" required>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">所属部门</label>
                            <div class="col-lg-4">
                                <select class="form-control" id="table_employeeManagent_detail_department" name="departmentDropDown" ng-model="detail.departmentId" ng-change="selectEmployee()" ng-options="x.id as x.name for x in departmentDropDown" name="departmentId">
                                    <option value="">请选择</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">性别</label>
                            <div class="">
                                <div class="radio col-lg-1">
                                    <label class="i-checks">
                                        <input id="table_employeeManagent_detail_male"  type="radio" name="male" ng-model="detail.sex" value="true">
                                        <i></i>
                                        男
                                    </label>
                                </div>
                                <div class="radio col-lg-1">
                                    <label class="i-checks">
                                        <input id="table_employeeManagent_detail_female" type="radio" name="female" ng-model="detail.sex" value="false">
                                        <i></i>
                                        女
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-3 control-label">用户状态</label>
                            <div class="col-lg-4">
                                <label class="checkbox i-checks">
                                    <input id="table_employeeManagent_detail_isEnabled" type="checkbox" class="" ng-model="detail.isEnabled" name="isEnabled"><i></i> 启用
                                </label>

                            </div>
                        </div>
                        <div class="form-group">
                            <tms-commissioner type-List="detail.types"></tms-commissioner>
                            <!-- <tms-authorization authority-List="detail.roles"></tms-authorization> -->
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" id="table_employeeManagent_detail_cancel" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" id="table_employeeManagent_detail_click" class="btn btn-primary" ng-click="detail.click()">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>


    <!-- 添加/编辑权限对话框 -->
    <div class="modal fade bs-example-modal-lg" id="authModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button id="table_authorizationManagent_detail_close" type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>

                    <button type="button" id="table_employeeManagent_expandAll" class="btn btn-primary" ng-click="toggleTree()">
						<span ng-if="!treeExpand">全部展开</span><span  ng-if="treeExpand">全部折叠</span>
					</button>

                </div>
                <form class="form-horizontal form-validation" id="authorizationForm" novalidate>
                    <div class="modal-body">
                        <div class="form-group">
                            <!-- <tms-commissioner type-List="detail.types"></tms-commissioner> -->
                            <tms-auth-tree auth-tree="authTree" tree-expand="treeExpand" auth-numbers="authNumbers" save-checked="saveChecked" sec-auth-type-tag="secAuthTypeTag"></tms-uth-tree>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" id="table_employeeManagent_auth_cancel" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" id="table_employeeManagent_auth_click" class="btn btn-primary" ng-click="saveCheckedAuth()">保存</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>